import React from "react";
import './TodoList.css';
import TodoHeader from "./TodoHeader/TodoHeader";
import TodoMain from "./TodoMain/TodoMain";
import TodoFooter from "./TodoFooter/TodoFooter";
import { useEffect} from 'react'
import {useDispatch} from 'react-redux'
import { asyncGetTodoList } from "../../app/slice/todoSlice";

export default function TodoList() {
  let dispatch=useDispatch()
  useEffect(() => {
    dispatch(asyncGetTodoList())
  },[])
  
  return (
    <div className="todo-container">
      <div className="todo-wrap">
        <TodoHeader />
        <TodoMain />
        <TodoFooter />
      </div>
    </div>
  );
}
